package com.pearl.jacksoncore.demo.databind.anno;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeId;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * @author TD
 * @version 1.0
 * @date 2024/3/26
 */
//@JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.WRAPPER_OBJECT)
@JsonSubTypes({
        @JsonSubTypes.Type(value = Student.class,name = "sut11111111"),
        @JsonSubTypes.Type(value = Teacher.class,name = "tea1111111")
})
public abstract class Person {

/*    @JsonTypeId
    private String typeId;

    protected Person(String typeId) {
        this.typeId = typeId;
    }

    public String getTypeId() {
        return typeId;
    }*/

/*    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }*/

    public String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
